package com.molin.IOtest.copyFileTest;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("C:\\molin\\a.avi");
        FileOutputStream fos=new FileOutputStream("D:\\IdeaProjects\\BasicCode\\mIdeaTest\\src\\com\\molin\\IOtest\\copyFileTest\\a.avi");

        byte [] bytes=new byte[1024];
        int len;
        //读取到的数据放到bytes中去，返回读取的字节个数
        while ((len=fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }

        fis.close();
        fos.close();
    }
}
